package com.kancy.drools.demo.list;

import com.kancy.drools.demo.BaseTests;
import com.kancy.drools.demo.DataArea;
import org.junit.Test;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;

import java.util.ArrayList;
import java.util.List;

/**
 * @author kancy
 * @date 2020/1/19 11:21
 **/
public class ListTests extends BaseTests {
    @Test
    public void test(){
        KieContainer kieContainer = getKieContainer();
        KieSession kieSession = kieContainer.newKieSession("list-session");
        List<Object> list = new ArrayList<>();
        list.add("kancy");
        list.add(25);
        list.add(176.0);
        list.add(new DataArea());
        kieSession.insert(list);
        kieSession.fireAllRules();
        kieSession.dispose();
    }
}
